<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;


    protected function token(string $token = ''){
        if($token){
            session('mytoken', $token);
        }else{
            return session("mytoken");
        }
    }

    protected function user(array $user = []){
        if(count($user) > 0){
            session('myuser', $user);
        }else{
            return session("myuser");
        }
    }
}
